package com.gigi.model.enums;

/**
 * 队伍状态枚举
 */
public enum TeamStatusEnum {
    PUBLIC(0, "0", "公开"),
    ENCRYPTED(1, "1", "加密");

    private Integer code;
    private String codeStr;
    private String desc;

    TeamStatusEnum(Integer code, String codeStr, String desc) {
        this.code = code;
        this.codeStr = codeStr;
        this.desc = desc;
    }

    public static TeamStatusEnum getEnumByCode(Integer code) {
        for (TeamStatusEnum status : TeamStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getCodeStr() {
        return codeStr;
    }
}
